<div class="right">
  <div></div>
  <div id="columns1">
     <div class="nav">
      <form action="<?=$this->config->item('site_url');?>SystemFunctions/vidguanbi" method="post" onsubmit="return selectdatesearch();" name="date_search_form">
        <ul>
          <li <?php if ($search_day ==0){ ?>class="current" <?php } ?>><span><a href="<?=$this->config->item("site_url");?>SystemFunctions/vidguanbi">今日</a></span></li>
          <li <?php if ($search_day ==1){ ?>class="current" <?php } ?>><span><a href="<?=$this->config->item("site_url");?>SystemFunctions/vidguanbi?search_day=1">昨日</a></span></li>
          <li <?php if ($search_day ==7){ ?>class="current" <?php } ?>><span><a href="<?=$this->config->item("site_url");?>SystemFunctions/vidguanbi?search_day=7">最近七天</a></span></li>
          <li <?php if ($search_day ==30){ ?>class="current" <?php } ?>><span><a href="<?=$this->config->item("site_url");?>SystemFunctions/vidguanbi?search_day=30">最近三十天</a></span></li>
          <li><span>从</span></li>
          <li><span class="demo">
            <input type="text" size="10" maxlength="8" readonly="readonly" value="<?=$search_sdate?>" id="datepicker" name="search_sdate">
            </span></li>
          <li><span>到</span></li>
          <li><span class="demo">
            <input type="text" id="datepicker1" size="10" value="<?=$search_edate?>" maxlength="8" name="search_edate">
            </span></li>
          <li class="lineNone"><span>
            <input type="button" value="查看" style="border: 1px #FFFFFF solid; background: #efefef;style=cursor:pointer" onclick="selectdatesearch()">
            </span></li>
        </ul>
      </form>
    </div> 
    <ul id="column2" class="main">
      <li class="widget1 color-green1" id="widget13">
        <div class="widget1-head">
          <h3> 从 <?=$search_sdate?> 到 <?=$search_edate?> 访客详情 </h3>
       </div>
        <div class="widget1-content">
          <table cellspacing="0" cellpadding="0">
            <tr>
			  <th> 序号 </th>
              <th> 访客 </th>
              <th> 地区 </th>
			  <th> 来访次数 </th>
			  <th> 停留时间(s) </th>
			  <th> 平均停留时间(s) </th>
			  <th> 恶意点击次数 </th>
			  <th> 有效点击比 </th>
			  <th> 操作 </th>
            </tr>



	<?php 
	if(!empty($viddata)){
	foreach(@$viddata as $key=>$val):?>								
                  <tr>
                    <td> <?=$key+1?> </td>
                    <td> <?=$val['vid']?> </td>
					<td> <?=$val['city']?> </td>
					<td> <?=$val['total_arriveCount']?></td>
					<td> <?=$val['total_stopTimes']?></td>
					<td> <?=$val['avg_stopTimes']?></td>
					<td> <?=$val['total_eyiclicks']?></td>
					<td> <?=$val['dianjibi']?>%</td>
					<td id="contral_td_<?=$val['vid']?>">
                    <?php if($val['state']!=1){?>
                         <label onclick="lanjie(<?=$val['vid']?>,1)" style="cursor:pointer;">拦截</label>
                    <?php }  ?>
                    <?php if($val['state']!=2){?>
                         <label onclick="lanjie(<?=$val['vid']?>,2)" style="cursor:pointer;">全面拦截</label>
                    <?php }  ?>
					<?php if($val['state']>0){?>
                    	<label onclick="lanjie(<?=$val['vid']?>,0)" style="cursor:pointer;">不拦截</label>
                    <?php } ?>
                    </td>
                  </tr>
 <?php endforeach;
 	}else{
 ?>
                  <tr>
                  <td colspan="13"><center>
                      <font color=red>无数据</font>
                    </center></td>
                </tr>
<?php } ?>				
          </table>
        </div>
      </li>
    </ul>
  </div>
</div>
</div>
</div>
</div>
</div>
<script type="text/javascript" src="<?=$this->config->item('js_url');?>date.js"></script>
<script type="text/javascript">
	function lanjie(vid,state)
	{
		$.ajax({
		   type: "POST",
		   url: "",
		   data: "lanjie_vid="+vid+"&state="+state,
		   success: function(msg){
		   		if(state == 1)
				{
					 $("#contral_td_"+vid).html("<label onclick='lanjie("+vid+",0)'>不拦截</label>");
				}else{
					$("#contral_td_"+vid).html("<label onclick='lanjie("+vid+",1)'>拦截</label>");
				}
		   }
		}); 
	}
</script>
